<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>公共组件</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        /* 顶部导航栏样式调整为截图中的深红色 */
        .top-nav {
            display: flex;
            justify-content: space-between;
            align-items: center;
            background-color: #9b2222; /* 更贴近截图的深红色 */
            color: #fff;
            padding: 10px 20px;
        }
        .top-nav-left {
            font-size: 16px;
        }
        .top-nav-middle {
            font-size: 20px;
            font-weight: bold;
        }
        .top-nav-right span {
            margin-left: 15px;
            cursor: pointer;
        }

        /* 侧边栏样式，保持与原有逻辑，确保宽度、定位等 */
        .sidebar {
            width: 200px;
            background-color: #fff;
            float: left;
            height: calc(100vh - 50px);
            padding-top: 20px;
            position: relative;
            border-right: 1px solid #eee; /* 可根据需要添加分割线视觉效果 */
        }
        .sidebar ul {
            list-style: none;
        }
        .sidebar li {
            padding: 12px 20px;
            cursor: pointer;
            transition: background-color 0.3s ease;
        }
        .sidebar li:hover {
            background-color: #ddd;
        }
        .sidebar li a {
            text-decoration: none;
            color: inherit;
            display: block;
        }
        .sidebar li.active {
            background-color: #ddd;
            font-weight: bold;
        }
    </style>
</head>
<body>
<!-- 顶部导航栏片段 -->
<div th:fragment="topbar" class="top-nav">
    <div class="top-nav-left">系统首页</div>
    <div class="top-nav-middle">加油站管理系统</div>
    <div class="top-nav-right">
        <span th:text="'管理员 '+${session.loginUser}"></span>
        <span><a href="/logout" style="color: white; text-decoration: none;">退出登录</a></span>
    </div>
</div>

<!-- 侧边栏片段 -->
<div th:fragment="sidebar" class="sidebar">
    <ul>
        <li><a href="/station_info/list" style="text-decoration: none; color: inherit;">加油站信息管理</a></li>
        <li><a href="/oil_info/list" style="text-decoration: none; color: inherit;">油品信息管理</a></li>
        <li><a href="/employee_info/list" style="text-decoration: none; color: inherit;">员工信息管理</a></li>
        <li><a href="/salesRecord/list" style="text-decoration: none; color: inherit;">销售信息管理</a></li>
    </ul>
</div>
</body>
</html>
